package com.company.project.config.file;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;

/**
 * @Author cjj
 * @Date 2018/12/28 9:28
 * @Description 上传文件返回对象
 **/

@Getter
@Setter
public class FileResult {
    //新生成的文件名字，为相对路径
    private String path;
    //原文件名
    private String name;
    //文件后缀
    private String pattern;
    //文件地址
    private String url;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private String createDate;

    public FileResult() {
    }

    public FileResult(String path, String name, String pattern, String url, String createDate) {
        this.path = path;
        this.name = name;
        this.pattern = pattern;
        this.url = url;
        this.createDate = createDate;
    }

    @Override
    public String toString() {
        return "FileResult{" +
                "path='" + path + '\'' +
                ", name='" + name + '\'' +
                ", pattern='" + pattern + '\'' +
                ", url='" + url + '\'' +
                ", createDate='" + createDate + '\'' +
                '}';
    }

}
